<?php
 /**
 * 
 * @author: trungdt
 * @since: Feb 22, 2011
 * @version: 1.0
 * 
 * Change logs
 */
if (!defined("EXPONENT")) exit("");
    $id=-1;
    if (isset($_REQUEST['id']))
    {
        $id=intval($_REQUEST['id']);
        $temp=$db->selectObjectsBySql("
        SELECT rhour, count(rmin) tmin FROM {$db->prefix}pray_register 
        WHERE ring_id = {$id} AND tmin=4
        GROUP BY rhour
        ORDER BY rhour");
        
        $data="";
        for ($i=0;$i<24;$i++){
            $found=false;
            foreach ($temp as $k=>$v){
                if ($v->rhour == $i)
                {
                    $found=true;
                    break;
                }
            }
            if ($found)
            {
                continue;
            }
            else
            {
                $data.="<option value={$i}>{$i}</option>";   
            }
        }
        echo $data;
    }
?>
